"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useWidgetPropDefaultValue = useWidgetPropDefaultValue;
var _vue = require("vue");
var _formItem = _interopRequireDefault(require("../../../form/src/form-item"));
var _select = _interopRequireDefault(require("../../../select/src/select"));
var _input = _interopRequireDefault(require("../../../input/src/input"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function useWidgetPropDefaultValue(props) {
  const defValOptions = (0, _vue.ref)([{
    value: 'custom',
    label: '自定义'
  }
  // { value: 'linkage', label: '数据联动' }
  ]);
  return {
    renderDefaultValueFormItem() {
      const {
        renderParams
      } = props;
      const {
        widget
      } = renderParams;
      const {
        defaultValue
      } = widget.options;
      return (0, _vue.h)(_formItem.default, {
        title: '默认值'
      }, {
        default() {
          return [(0, _vue.h)(_select.default, {
            modelValue: defaultValue.type,
            options: defValOptions.value,
            'onUpdate:modelValue'(val) {
              defaultValue.type = val;
            }
          }), (0, _vue.h)(_input.default, {
            modelValue: defaultValue.value,
            'onUpdate:modelValue'(val) {
              defaultValue.value = val;
            }
          })];
        }
      });
    }
  };
}